package com.ruoyi.charging.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.charging.mapper.ChargingUserVehicleBindMapper;
import com.ruoyi.charging.domain.ChargingUserVehicleBind;
import com.ruoyi.charging.service.IChargingUserVehicleBindService;

/**
 * 车辆绑定Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-18
 */
@Service
public class ChargingUserVehicleBindServiceImpl implements IChargingUserVehicleBindService 
{
    @Autowired
    private ChargingUserVehicleBindMapper chargingUserVehicleBindMapper;

    /**
     * 查询车辆绑定
     * 
     * @param id 车辆绑定主键
     * @return 车辆绑定
     */
    @Override
    public ChargingUserVehicleBind selectChargingUserVehicleBindById(Long id)
    {
        return chargingUserVehicleBindMapper.selectChargingUserVehicleBindById(id);
    }

    /**
     * 查询车辆绑定列表
     * 
     * @param chargingUserVehicleBind 车辆绑定
     * @return 车辆绑定
     */
    @Override
    public List<ChargingUserVehicleBind> selectChargingUserVehicleBindList(ChargingUserVehicleBind chargingUserVehicleBind)
    {
        return chargingUserVehicleBindMapper.selectChargingUserVehicleBindList(chargingUserVehicleBind);
    }

    /**
     * 新增车辆绑定
     * 
     * @param chargingUserVehicleBind 车辆绑定
     * @return 结果
     */
    @Override
    public int insertChargingUserVehicleBind(ChargingUserVehicleBind chargingUserVehicleBind)
    {
        chargingUserVehicleBind.setCreateTime(DateUtils.getNowDate());
        return chargingUserVehicleBindMapper.insertChargingUserVehicleBind(chargingUserVehicleBind);
    }

    /**
     * 修改车辆绑定
     * 
     * @param chargingUserVehicleBind 车辆绑定
     * @return 结果
     */
    @Override
    public int updateChargingUserVehicleBind(ChargingUserVehicleBind chargingUserVehicleBind)
    {
        return chargingUserVehicleBindMapper.updateChargingUserVehicleBind(chargingUserVehicleBind);
    }

    /**
     * 批量删除车辆绑定
     * 
     * @param ids 需要删除的车辆绑定主键
     * @return 结果
     */
    @Override
    public int deleteChargingUserVehicleBindByIds(Long[] ids)
    {
        return chargingUserVehicleBindMapper.deleteChargingUserVehicleBindByIds(ids);
    }

    /**
     * 删除车辆绑定信息
     * 
     * @param id 车辆绑定主键
     * @return 结果
     */
    @Override
    public int deleteChargingUserVehicleBindById(Long id)
    {
        return chargingUserVehicleBindMapper.deleteChargingUserVehicleBindById(id);
    }
}
